<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
    <h:head>
        <title>Tra cứu System Log</title>        
    </h:head>
    <h:body> 
        <link type="text/css" rel="stylesheet" href="../css/main.css" />        
        <style type="text/css">
            .ui-widget{font-size:95% !important;}
            .ui-layout-unit-content{background-color: #E5E5E5;border-width: 0px}      
            .ui-widget{border-width: 0px;color: red}
        </style>
        <div align="center" id="bodyForm" >            
            <div style="width: 100%;">
                <p:layoutUnit id="top" position="north" size="auto">
                    <ui:insert name="menu">
                        <ui:include src="../../templates/menu.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>

                <p:layoutUnit id="center" position="center" size="400">
                    <h1 class="headerbar">Tra cứu System Log</h1>
                    <h:form id="form">
                        <p:dialog modal="true" widgetVar="statusDialog" header="Đang tìm kiếm.."   
                                  draggable="false" closable="false">  
                            <p:graphicImage value="../../images/ajax-loader.gif" />  
                        </p:dialog>
                        <br></br>
                        <p:growl/> 
                        <h:panelGrid columns="4">
                            <h:outputText value="Từ ngày: "/> <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{sYSTEM_LOGController.tuNgay}" required="true" requiredMessage="Không được để trống từ ngày!"/>
                            <h:outputText value="Đến ngày: "/> <p:calendar pattern="dd-MM-yyyy" showOn="button" value="#{sYSTEM_LOGController.denNgay}" required="true" requiredMessage="Không được để trống đến ngày!"/>
                            <h:outputText value="Tag: "/> <p:inputText value="#{sYSTEM_LOGController.tagS}"/>
                        </h:panelGrid>                                                    
                        <p:commandButton value="Tra cứu" update=":form" onclick="statusDialog.show();" oncomplete="statusDialog.hide();" action="#{sYSTEM_LOGController.tracuu()}"/>
                        <p:dataTable value="#{sYSTEM_LOGController.lazyDataModel}" var="sl" lazy="true"
                                     paginator="true" rows="40" rowsPerPageTemplate="40,45,50" paginatorPosition="bottom"
                                     style="width: 70%">
                            <p:column headerText="Ngày">
                                <h:outputText value="#{sl.log_date}" style="float: right"/>
                            </p:column>
                            <p:column headerText="Tag">
                                <h:outputText value="#{sl.tag}" style="float: right"/>
                            </p:column>
                            <p:column headerText="Log">
                                <h:outputText value="#{sl.log}" style="float: right"/>
                            </p:column>
                        </p:dataTable>                        
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit id="bottom" position="bottom" size="60">
                    <ui:insert name="footer">
                        <ui:include src="../../templates/footer.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>
            </div>
        </div>
    </h:body>
</html>

